home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / E-G / educationstacks.sea / Circuits / card_5151.txt < prev    next >
Text File  |  1989-02-26  |  8KB  |  339 lines

  1. -- card: 5151 from stack: in
  2. -- bmap block id: 5737
  3. -- flags: 4000
  4. -- background id: 2693
  5. -- name: 
  6. ----- HyperTalk script -----
  7. on calculate
  8.   get char 1 of card field "EMF"
  9.   if it="+" then
  10.     delete char 1 of card field "EMF"
  11.   end if
  12.   put card field "EMF" into E
  13.  
  14.   get char 1 of card field "R1"
  15.   if it="+" then
  16.     delete char 1 of card field "R1"
  17.   end if
  18.   put card field "R1" into R1
  19.   put abs(R1) into R1
  20.   put R1 into card field "R1"
  21.  
  22.   get char 1 of card field "R2"
  23.   if it="+" then
  24.     delete char 1 of card field "R2"
  25.   end if
  26.   put card field "R2" into R2
  27.   put abs(R2) into R2
  28.   put R2 into card field "R2"
  29.  
  30.   if E=0 then
  31.     send zeroall
  32.     exit calculate
  33.   end if
  34.  
  35.   if R1=0 and R2=0 then
  36.     put "zap" into card field "A1"
  37.     put "zap" into card field "A2"
  38.     put "zap" into card field "A3"
  39.     put E into card field "V1"
  40.     exit calculate
  41.   end if
  42.  
  43.   if R1=0 then
  44.     put "zap" into card field "A1"
  45.     put "zap" into card field "A3"
  46.     put 0 into card field "A2"
  47.     put E into card field "V1"
  48.     exit calculate
  49.   end if
  50.  
  51.   if R2=0 then
  52.     put "zap" into card field "A2"
  53.     put "zap" into card field "A3"
  54.     put 0 into card field "A1"
  55.     put E into card field "V1"
  56.     exit calculate
  57.   end if
  58.  
  59.   put E/R1 into I1
  60.   put E/R2 into I2
  61.   put I1+I2 into I3
  62.   set numberFormat to "0.000"
  63.   put E*1 into card field "V1"
  64.   put I1 into card field "A1"
  65.   put I2 into card field "A2"
  66.   put I3 into card field "A3"
  67.  
  68. end calculate
  69.  
  70. on closeField
  71.   set hilite of card button "S1 closed" to false
  72.   set hilite of card button "S1 middle" to true
  73.   set hilite of card button "S1 middle" to false
  74.   set hilite of card button "S1 open" to true
  75.   send zeroall
  76. end closeField
  77.  
  78. on zeroall
  79.   put 0 into card field "V1"
  80.   put 0 into card field "A1"
  81.   put 0 into card field "A2"
  82.   put 0 into card field "A3"
  83. end zeroall
  84.  
  85.  
  86.  
  87. -- part 1 (field)
  88. -- low flags: 01
  89. -- high flags: 0002
  90. -- rect: left=158 top=257 right=272 bottom=214
  91. -- title width / last selected line: 0
  92. -- icon id / first selected line: 0 / 0
  93. -- text alignment: 65535
  94. -- font id: 128
  95. -- text size: 10
  96. -- style flags: 256
  97. -- line height: 13
  98. -- part name: A3
  99.  
  100.  
  101. -- part 2 (field)
  102. -- low flags: 01
  103. -- high flags: 0002
  104. -- rect: left=141 top=158 right=173 bottom=206
  105. -- title width / last selected line: 0
  106. -- icon id / first selected line: 0 / 0
  107. -- text alignment: 65535
  108. -- font id: 128
  109. -- text size: 10
  110. -- style flags: 256
  111. -- line height: 13
  112. -- part name: V1
  113.  
  114.  
  115. -- part 3 (field)
  116. -- low flags: 01
  117. -- high flags: 0002
  118. -- rect: left=269 top=197 right=212 bottom=325
  119. -- title width / last selected line: 0
  120. -- icon id / first selected line: 0 / 0
  121. -- text alignment: 65535
  122. -- font id: 128
  123. -- text size: 10
  124. -- style flags: 256
  125. -- line height: 13
  126. -- part name: A1
  127.  
  128.  
  129. -- part 4 (field)
  130. -- low flags: 01
  131. -- high flags: 0002
  132. -- rect: left=396 top=197 right=212 bottom=452
  133. -- title width / last selected line: 0
  134. -- icon id / first selected line: 0 / 0
  135. -- text alignment: 65535
  136. -- font id: 128
  137. -- text size: 10
  138. -- style flags: 256
  139. -- line height: 13
  140. -- part name: A2
  141.  
  142.  
  143. -- part 5 (field)
  144. -- low flags: 00
  145. -- high flags: 0000
  146. -- rect: left=2 top=90 right=117 bottom=64
  147. -- title width / last selected line: 0
  148. -- icon id / first selected line: 0 / 0
  149. -- text alignment: 65535
  150. -- font id: 3
  151. -- text size: 18
  152. -- style flags: 256
  153. -- line height: 24
  154. -- part name: EMF
  155.  
  156.  
  157. -- part 6 (field)
  158. -- low flags: 00
  159. -- high flags: 0000
  160. -- rect: left=164 top=96 right=123 bottom=226
  161. -- title width / last selected line: 0
  162. -- icon id / first selected line: 0 / 0
  163. -- text alignment: 65535
  164. -- font id: 3
  165. -- text size: 18
  166. -- style flags: 256
  167. -- line height: 24
  168. -- part name: R1
  169.  
  170.  
  171. -- part 7 (field)
  172. -- low flags: 00
  173. -- high flags: 0000
  174. -- rect: left=291 top=96 right=123 bottom=353
  175. -- title width / last selected line: 0
  176. -- icon id / first selected line: 0 / 0
  177. -- text alignment: 65535
  178. -- font id: 3
  179. -- text size: 18
  180. -- style flags: 256
  181. -- line height: 24
  182. -- part name: R2
  183.  
  184.  
  185. -- part 8 (button)
  186. -- low flags: 00
  187. -- high flags: 4001
  188. -- rect: left=81 top=199 right=219 bottom=93
  189. -- title width / last selected line: 0
  190. -- icon id / first selected line: 0 / 0
  191. -- text alignment: 1
  192. -- font id: 0
  193. -- text size: 12
  194. -- style flags: 0
  195. -- line height: 16
  196. -- part name: S1 closed
  197. ----- HyperTalk script -----
  198. on mouseUp
  199.   get hilite of card button "S1 closed"
  200.   if it=true then
  201.     set hilite of card button "S1 closed" to false
  202.     set hilite of card button "S1 middle" to true
  203.     set hilite of card button "S1 middle" to false
  204.     set hilite of card button "S1 open" to true
  205.     send zeroall
  206.   else
  207.     set hilite of card button "S1 open" to false
  208.     set hilite of card button "S1 middle" to true
  209.     set hilite of card button "S1 middle" to false
  210.     set hilite of card button "S1 closed" to true
  211.     send calculate
  212.   end if
  213. end mouseUp
  214.  
  215.  
  216. -- part 9 (button)
  217. -- low flags: 00
  218. -- high flags: 0001
  219. -- rect: left=70 top=199 right=219 bottom=82
  220. -- title width / last selected line: 0
  221. -- icon id / first selected line: 0 / 0
  222. -- text alignment: 1
  223. -- font id: 0
  224. -- text size: 12
  225. -- style flags: 0
  226. -- line height: 16
  227. -- part name: S1 middle
  228. ----- HyperTalk script -----
  229. on mouseUp
  230.   get hilite of card button "S1 closed"
  231.   if it=true then
  232.     set hilite of card button "S1 closed" to false
  233.     set hilite of card button "S1 middle" to true
  234.     set hilite of card button "S1 middle" to false
  235.     set hilite of card button "S1 open" to true
  236.     send zeroall
  237.   else
  238.     set hilite of card button "S1 open" to false
  239.     set hilite of card button "S1 middle" to true
  240.     set hilite of card button "S1 middle" to false
  241.     set hilite of card button "S1 closed" to true
  242.     send calculate
  243.   end if
  244. end mouseUp
  245.  
  246.  
  247. -- part 10 (button)
  248. -- low flags: 00
  249. -- high flags: 0001
  250. -- rect: left=59 top=199 right=219 bottom=71
  251. -- title width / last selected line: 0
  252. -- icon id / first selected line: 0 / 0
  253. -- text alignment: 1
  254. -- font id: 0
  255. -- text size: 12
  256. -- style flags: 0
  257. -- line height: 16
  258. -- part name: S1 open
  259. ----- HyperTalk script -----
  260. on mouseUp
  261.   get hilite of card button "S1 closed"
  262.   if it=true then
  263.     set hilite of card button "S1 closed" to false
  264.     set hilite of card button "S1 middle" to true
  265.     set hilite of card button "S1 middle" to false
  266.     set hilite of card button "S1 open" to true
  267.     send zeroall
  268.   else
  269.     set hilite of card button "S1 open" to false
  270.     set hilite of card button "S1 middle" to true
  271.     set hilite of card button "S1 middle" to false
  272.     set hilite of card button "S1 closed" to true
  273.     send calculate
  274.   end if
  275. end mouseUp
  276.  
  277.  
  278. -- part 12 (button)
  279. -- low flags: 00
  280. -- high flags: 0000
  281. -- rect: left=94 top=200 right=219 bottom=137
  282. -- title width / last selected line: 0
  283. -- icon id / first selected line: 0 / 0
  284. -- text alignment: 1
  285. -- font id: 0
  286. -- text size: 12
  287. -- style flags: 0
  288. -- line height: 16
  289. -- part name: Switch
  290. ----- HyperTalk script -----
  291. on mouseUp
  292.   get hilite of card button "S1 closed"
  293.   if it=true then
  294.     set hilite of card button "S1 closed" to false
  295.     set hilite of card button "S1 middle" to true
  296.     set hilite of card button "S1 middle" to false
  297.     set hilite of card button "S1 open" to true
  298.     send zeroall
  299.   else
  300.     set hilite of card button "S1 open" to false
  301.     set hilite of card button "S1 middle" to true
  302.     set hilite of card button "S1 middle" to false
  303.     set hilite of card button "S1 closed" to true
  304.     send calculate
  305.   end if
  306. end mouseUp
  307.  
  308.  
  309. -- part contents for background part 8
  310. ----- text -----
  311. C3. Parallel
  312.  
  313. -- part contents for card part 2
  314. ----- text -----
  315. 10.000
  316.  
  317. -- part contents for card part 3
  318. ----- text -----
  319. 2.500
  320.  
  321. -- part contents for card part 4
  322. ----- text -----
  323. 1.250
  324.  
  325. -- part contents for card part 1
  326. ----- text -----
  327. 3.750
  328.  
  329. -- part contents for card part 5
  330. ----- text -----
  331. 10
  332.  
  333. -- part contents for card part 6
  334. ----- text -----
  335. 4
  336.  
  337. -- part contents for card part 7
  338. ----- text -----
  339. 8